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

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

Issue 218393003: Use OwnPtr|PassOwnPtr to pass a pointer of NavigatorContentUtilsClient instance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
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*>(RefCountedSupplement<Page, Naviga torContentUtils>::from(page, NavigatorContentUtils::supplementName()));
125 } 125 }
126 126
127 NavigatorContentUtils::~NavigatorContentUtils() 127 NavigatorContentUtils::~NavigatorContentUtils()
128 { 128 {
129 } 129 }
130 130
131 PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(NavigatorContent UtilsClient* client) 131 PassRefPtr<NavigatorContentUtils> NavigatorContentUtils::create(PassOwnPtr<Navig atorContentUtilsClient> client)
132 { 132 {
133 return adoptRef(new NavigatorContentUtils(client)); 133 return adoptRef(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();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 ASSERT(navigator.frame()->page()); 210 ASSERT(navigator.frame()->page());
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, NavigatorContentUtilsClient* cli ent) 219 void provideNavigatorContentUtilsTo(Page& page, PassOwnPtr<NavigatorContentUtils Client> client)
220 { 220 {
221 RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, Navigator ContentUtils::supplementName(), NavigatorContentUtils::create(client)); 221 RefCountedSupplement<Page, NavigatorContentUtils>::provideTo(page, Navigator ContentUtils::supplementName(), NavigatorContentUtils::create(client));
222 } 222 }
223 223
224 } // namespace WebCore 224 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698