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

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

Issue 2608793002: DevTools: Fix storage handler host-setting (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « content/browser/devtools/protocol/storage_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/storage_handler.h" 5 #include "content/browser/devtools/protocol/storage_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <unordered_set> 8 #include <unordered_set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 22 matching lines...) Expand all
33 : DevToolsDomainHandler(Storage::Metainfo::domainName), 33 : DevToolsDomainHandler(Storage::Metainfo::domainName),
34 host_(nullptr) { 34 host_(nullptr) {
35 } 35 }
36 36
37 StorageHandler::~StorageHandler() = default; 37 StorageHandler::~StorageHandler() = default;
38 38
39 void StorageHandler::Wire(UberDispatcher* dispatcher) { 39 void StorageHandler::Wire(UberDispatcher* dispatcher) {
40 Storage::Dispatcher::wire(dispatcher, this); 40 Storage::Dispatcher::wire(dispatcher, this);
41 } 41 }
42 42
43 void StorageHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
44 host_ = host;
45 }
46
43 Response StorageHandler::ClearDataForOrigin( 47 Response StorageHandler::ClearDataForOrigin(
44 const std::string& origin, 48 const std::string& origin,
45 const std::string& storage_types) { 49 const std::string& storage_types) {
46 if (!host_) 50 if (!host_)
47 return Response::InternalError(); 51 return Response::InternalError();
48 52
49 StoragePartition* partition = host_->GetProcess()->GetStoragePartition(); 53 StoragePartition* partition = host_->GetProcess()->GetStoragePartition();
50 std::vector<std::string> types = base::SplitString( 54 std::vector<std::string> types = base::SplitString(
51 storage_types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); 55 storage_types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
52 std::unordered_set<std::string> set(types.begin(), types.end()); 56 std::unordered_set<std::string> set(types.begin(), types.end());
(...skipping 26 matching lines...) Expand all
79 remove_mask, 83 remove_mask,
80 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL, 84 StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL,
81 GURL(origin), 85 GURL(origin),
82 partition->GetURLRequestContext(), 86 partition->GetURLRequestContext(),
83 base::Bind(&base::DoNothing)); 87 base::Bind(&base::DoNothing));
84 return Response::OK(); 88 return Response::OK();
85 } 89 }
86 90
87 } // namespace protocol 91 } // namespace protocol
88 } // namespace content 92 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/storage_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698