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

Side by Side Diff: Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp

Issue 235023003: Mark Supplement instead of RefCountedSupplement in NavigatorContentUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 8 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 | « Source/modules/navigatorcontentutils/NavigatorContentUtils.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 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * Copyright (C) 2012, Samsung Electronics. All rights reserved. 3 * Copyright (C) 2012, Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 115
116 if (isProtocolWhitelisted(scheme)) 116 if (isProtocolWhitelisted(scheme))
117 return true; 117 return true;
118 exceptionState.throwSecurityError("The scheme '" + scheme + "' doesn't belon g to the protocol whitelist. Please prefix non-whitelisted schemes with the stri ng 'web+'."); 118 exceptionState.throwSecurityError("The scheme '" + scheme + "' doesn't belon g to the protocol whitelist. Please prefix non-whitelisted schemes with the stri ng 'web+'.");
119 return false; 119 return false;
120 } 120 }
121 121
122 NavigatorContentUtils* NavigatorContentUtils::from(Page& page) 122 NavigatorContentUtils* NavigatorContentUtils::from(Page& page)
123 { 123 {
124 return static_cast<NavigatorContentUtils*>(RefCountedSupplement<Page, Naviga torContentUtils>::from(page, NavigatorContentUtils::supplementName())); 124 return static_cast<NavigatorContentUtils*>(Supplement<Page>::from(page, supp lementName()));
125 } 125 }
126 126
127 NavigatorContentUtils::~NavigatorContentUtils() 127 NavigatorContentUtils::~NavigatorContentUtils()
128 { 128 {
129 } 129 }
130 130
131 PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtr<Navig atorContentUtilsClient> client) 131 PassOwnPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtr<Navig atorContentUtilsClient> client)
132 { 132 {
133 return adoptRef(new NavigatorContentUtils(client)); 133 return adoptPtr(new NavigatorContentUtils(client));
134 } 134 }
135 135
136 void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptio nState) 136 void NavigatorContentUtils::registerProtocolHandler(Navigator& navigator, const String& scheme, const String& url, const String& title, ExceptionState& exceptio nState)
137 { 137 {
138 if (!navigator.frame()) 138 if (!navigator.frame())
139 return; 139 return;
140 140
141 Document* document = navigator.frame()->document(); 141 Document* document = navigator.frame()->document();
142 if (!document) 142 if (!document)
143 return; 143 return;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 NavigatorContentUtils::from(*navigator.frame()->page())->client()->unregiste rProtocolHandler(scheme, baseURL, KURL(ParsedURLString, url)); 211 NavigatorContentUtils::from(*navigator.frame()->page())->client()->unregiste rProtocolHandler(scheme, baseURL, KURL(ParsedURLString, url));
212 } 212 }
213 213
214 const char* NavigatorContentUtils::supplementName() 214 const char* NavigatorContentUtils::supplementName()
215 { 215 {
216 return "NavigatorContentUtils"; 216 return "NavigatorContentUtils";
217 } 217 }
218 218
219 void provideNavigatorContentUtilsTo(Page& page, PassOwnPtr<NavigatorContentUtils Client> client) 219 void provideNavigatorContentUtilsTo(Page& page, PassOwnPtr<NavigatorContentUtils Client> client)
220 { 220 {
221 RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, Navigator ContentUtils::supplementName(), NavigatorContentUtils::create(client)); 221 NavigatorContentUtils::provideTo(page, NavigatorContentUtils::supplementName (), NavigatorContentUtils::create(client));
222 } 222 }
223 223
224 } // namespace WebCore 224 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/navigatorcontentutils/NavigatorContentUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698