[Cronet] Delay StartNetLog and StopNetLog until native request context is initialized
[chromium-blink-merge.git] / chrome / browser / devtools / device / webrtc / send_command_request.h
blobfaefac1f742f3f226d0c79c2354f41f6c825cede
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_
8 #include "chrome/browser/local_discovery/gcd_api_flow.h"
10 class SendCommandRequest : public local_discovery::GCDApiFlowRequest {
11 public:
12 class Delegate {
13 public:
14 // It's safe to destroy SendCommandRequest in these methods.
15 virtual void OnCommandSucceeded(const base::DictionaryValue& value) = 0;
16 virtual void OnCommandFailed() = 0;
18 protected:
19 ~Delegate() {}
22 SendCommandRequest(const base::DictionaryValue* request, Delegate* delegate);
24 // Implementation of GCDApiFlowRequest.
25 net::URLFetcher::RequestType GetRequestType() override;
26 void GetUploadData(std::string* upload_type,
27 std::string* upload_data) override;
28 void OnGCDAPIFlowError(local_discovery::GCDApiFlow::Status status) override;
29 void OnGCDAPIFlowComplete(const base::DictionaryValue& value) override;
30 GURL GetURL() override;
32 private:
33 std::string upload_data_;
34 Delegate* const delegate_;
36 DISALLOW_COPY_AND_ASSIGN(SendCommandRequest);
39 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_