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

Side by Side Diff: extensions/browser/api/guest_view/web_view/web_view_internal_api.cc

Issue 2118473002: 😴 Skip some KeepAlive registrations on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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 | « chrome/chrome_tests_unit.gypi ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" 5 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id)); 253 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &instance_id));
254 WebViewGuest* guest = WebViewGuest::From( 254 WebViewGuest* guest = WebViewGuest::From(
255 render_frame_host()->GetProcess()->GetID(), instance_id); 255 render_frame_host()->GetProcess()->GetID(), instance_id);
256 if (!guest) 256 if (!guest)
257 return false; 257 return false;
258 258
259 return RunAsyncSafe(guest); 259 return RunAsyncSafe(guest);
260 } 260 }
261 261
262 bool WebViewInternalExtensionFunction::PreRunValidation(std::string* error) { 262 bool WebViewInternalExtensionFunction::PreRunValidation(std::string* error) {
263 if (!UIThreadExtensionFunction::PreRunValidation(error))
264 return false;
265
263 int instance_id = 0; 266 int instance_id = 0;
264 EXTENSION_FUNCTION_PRERUN_VALIDATE(args_->GetInteger(0, &instance_id)); 267 EXTENSION_FUNCTION_PRERUN_VALIDATE(args_->GetInteger(0, &instance_id));
265 guest_ = WebViewGuest::From(render_frame_host()->GetProcess()->GetID(), 268 guest_ = WebViewGuest::From(render_frame_host()->GetProcess()->GetID(),
266 instance_id); 269 instance_id);
267 if (!guest_) { 270 if (!guest_) {
268 *error = "Could not find guest"; 271 *error = "Could not find guest";
269 return false; 272 return false;
270 } 273 }
271 return true; 274 return true;
272 } 275 }
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 // Will finish asynchronously. 965 // Will finish asynchronously.
963 return true; 966 return true;
964 } 967 }
965 968
966 void WebViewInternalClearDataFunction::ClearDataDone() { 969 void WebViewInternalClearDataFunction::ClearDataDone() {
967 Release(); // Balanced in RunAsync(). 970 Release(); // Balanced in RunAsync().
968 SendResponse(true); 971 SendResponse(true);
969 } 972 }
970 973
971 } // namespace extensions 974 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698