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

Side by Side Diff: chrome/browser/extensions/tab_helper.cc

Issue 2485253002: Remove unnecessary calls to GURL() (Closed)
Patch Set: Assert that StringPiece must always be canonicalized. Fix some constants. Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/tab_helper.h" 5 #include "chrome/browser/extensions/tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 int return_route_id, 434 int return_route_id,
435 const std::string& webstore_item_id, 435 const std::string& webstore_item_id,
436 int listeners_mask) { 436 int listeners_mask) {
437 GURL requestor_url(host->GetLastCommittedURL()); 437 GURL requestor_url(host->GetLastCommittedURL());
438 // Check that the listener is reasonable. We should never get anything other 438 // Check that the listener is reasonable. We should never get anything other
439 // than an install stage listener, a download listener, or both. 439 // than an install stage listener, a download listener, or both.
440 // The requestor_url should also be valid, and the renderer should disallow 440 // The requestor_url should also be valid, and the renderer should disallow
441 // child frames from sending the IPC. 441 // child frames from sending the IPC.
442 if ((listeners_mask & ~(api::webstore::INSTALL_STAGE_LISTENER | 442 if ((listeners_mask & ~(api::webstore::INSTALL_STAGE_LISTENER |
443 api::webstore::DOWNLOAD_PROGRESS_LISTENER)) != 0 || 443 api::webstore::DOWNLOAD_PROGRESS_LISTENER)) != 0 ||
444 !requestor_url.is_valid() || requestor_url == GURL(url::kAboutBlankURL) || 444 !requestor_url.is_valid() || requestor_url == url::kAboutBlankURL ||
445 host->GetParent()) { 445 host->GetParent()) {
446 NOTREACHED(); 446 NOTREACHED();
447 return; 447 return;
448 } 448 }
449 449
450 if (pending_inline_installations_.count(webstore_item_id) != 0) { 450 if (pending_inline_installations_.count(webstore_item_id) != 0) {
451 Send(new ExtensionMsg_InlineWebstoreInstallResponse( 451 Send(new ExtensionMsg_InlineWebstoreInstallResponse(
452 return_route_id, install_id, false, 452 return_route_id, install_id, false,
453 webstore_install::kInstallInProgressError, 453 webstore_install::kInstallInProgressError,
454 webstore_install::INSTALL_IN_PROGRESS)); 454 webstore_install::INSTALL_IN_PROGRESS));
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 } 676 }
677 677
678 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) { 678 void TabHelper::SetTabId(content::RenderFrameHost* render_frame_host) {
679 render_frame_host->Send( 679 render_frame_host->Send(
680 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(), 680 new ExtensionMsg_SetTabId(render_frame_host->GetRoutingID(),
681 SessionTabHelper::IdForTab(web_contents()))); 681 SessionTabHelper::IdForTab(web_contents())));
682 } 682 }
683 683
684 } // namespace extensions 684 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_api.cc ('k') | chrome/browser/history/history_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698