Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: content/browser/devtools/protocol/dom_handler.cc

Issue 2548263002: [DevTools] Migrate dom, emulation, inspector, network, page and schema handlers to new generator. (Closed)
Patch Set: rebased atop of roll Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/devtools/protocol/dom_handler.h" 5 #include "content/browser/devtools/protocol/dom_handler.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/frame_host/render_frame_host_impl.h" 10 #include "content/browser/frame_host/render_frame_host_impl.h"
11 11
12 namespace content { 12 namespace content {
13 namespace devtools { 13 namespace protocol {
14 namespace dom {
15
16 typedef DevToolsProtocolClient::Response Response;
17 14
18 DOMHandler::DOMHandler() : host_(nullptr) { 15 DOMHandler::DOMHandler() : host_(nullptr) {
19 } 16 }
20 17
21 DOMHandler::~DOMHandler() { 18 DOMHandler::~DOMHandler() {
22 } 19 }
23 20
21 void DOMHandler::Wire(UberDispatcher* dispatcher) {
22 DOM::Dispatcher::wire(dispatcher, this);
23 }
24
24 void DOMHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { 25 void DOMHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
25 host_ = host; 26 host_ = host;
26 } 27 }
27 28
28 Response DOMHandler::SetFileInputFiles(NodeId node_id, 29 Response DOMHandler::Disable() {
29 const std::vector<std::string>& files) { 30 return Response::OK();
31 }
32
33 Response DOMHandler::SetFileInputFiles(
34 DOM::NodeId node_id,
35 std::unique_ptr<protocol::Array<std::string>> files) {
30 if (host_) { 36 if (host_) {
31 for (const auto& file : files) { 37 for (size_t i = 0; i < files->length(); i++) {
32 #if defined(OS_WIN) 38 #if defined(OS_WIN)
33 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( 39 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
34 host_->GetProcess()->GetID(), 40 host_->GetProcess()->GetID(),
35 base::FilePath(base::UTF8ToUTF16(file))); 41 base::FilePath(base::UTF8ToUTF16(files->get(i))));
36 #else 42 #else
37 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( 43 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
38 host_->GetProcess()->GetID(), 44 host_->GetProcess()->GetID(),
39 base::FilePath(file)); 45 base::FilePath(files->get(i)));
40 #endif // OS_WIN 46 #endif // OS_WIN
41 } 47 }
42 } 48 }
43 return Response::FallThrough(); 49 return Response::FallThrough();
44 } 50 }
45 51
46 } // namespace dom 52 } // namespace protocol
47 } // namespace devtools
48 } // namespace content 53 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/dom_handler.h ('k') | content/browser/devtools/protocol/emulation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698