Skip to content

Commit

Permalink
Fix reinterpret_cast issues
Browse files Browse the repository at this point in the history
It looks like these places are using incorrect casting (reinterpret_cast instead of
static_cast) for GetUserData.

BUG=

Review URL: https://codereview.chromium.org/629503004

Cr-Commit-Position: refs/heads/master@{#298743}
  • Loading branch information
dtrainor authored and Commit bot committed Oct 8, 2014
1 parent 40720d6 commit 037df0d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion android_webview/browser/aw_contents_client_bridge_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UserData : public base::SupportsUserData::Data {
content::WebContents* web_contents) {
if (!web_contents)
return NULL;
UserData* data = reinterpret_cast<UserData*>(
UserData* data = static_cast<UserData*>(
web_contents->GetUserData(kAwContentsClientBridgeBase));
return data ? data->contents_ : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion android_webview/native/aw_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class AwContentsUserData : public base::SupportsUserData::Data {
static AwContents* GetContents(WebContents* web_contents) {
if (!web_contents)
return NULL;
AwContentsUserData* data = reinterpret_cast<AwContentsUserData*>(
AwContentsUserData* data = static_cast<AwContentsUserData*>(
web_contents->GetUserData(kAwContentsUserDataKey));
return data ? data->contents_ : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion android_webview/native/aw_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AwSettingsUserData : public base::SupportsUserData::Data {
static AwSettings* GetSettings(content::WebContents* web_contents) {
if (!web_contents)
return NULL;
AwSettingsUserData* data = reinterpret_cast<AwSettingsUserData*>(
AwSettingsUserData* data = static_cast<AwSettingsUserData*>(
web_contents->GetUserData(kAwSettingsUserDataKey));
return data ? data->settings_ : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/android/bookmarks/partner_bookmarks_shim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ PartnerBookmarksShim* PartnerBookmarksShim::BuildForBrowserContext(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));

PartnerBookmarksShim* data =
reinterpret_cast<PartnerBookmarksShim*>(
static_cast<PartnerBookmarksShim*>(
browser_context->GetUserData(kPartnerBookmarksShimUserDataKey));
if (data)
return data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void InterceptNavigationDelegate::Associate(
// static
InterceptNavigationDelegate* InterceptNavigationDelegate::Get(
WebContents* web_contents) {
return reinterpret_cast<InterceptNavigationDelegate*>(
return static_cast<InterceptNavigationDelegate*>(
web_contents->GetUserData(kInterceptNavigationDelegateUserDataKey));
}

Expand Down
2 changes: 1 addition & 1 deletion content/browser/android/content_view_core_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class ContentViewCoreImpl::ContentViewUserData
ContentViewCoreImpl* ContentViewCoreImpl::FromWebContents(
content::WebContents* web_contents) {
ContentViewCoreImpl::ContentViewUserData* data =
reinterpret_cast<ContentViewCoreImpl::ContentViewUserData*>(
static_cast<ContentViewCoreImpl::ContentViewUserData*>(
web_contents->GetUserData(kContentViewUserDataKey));
return data ? data->get() : NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion content/browser/appcache/appcache_interceptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void AppCacheInterceptor::SetHandler(net::URLRequest* request,

AppCacheRequestHandler* AppCacheInterceptor::GetHandler(
net::URLRequest* request) {
return reinterpret_cast<AppCacheRequestHandler*>(
return static_cast<AppCacheRequestHandler*>(
request->GetUserData(GetInstance()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void ServiceWorkerRequestHandler::InitializeHandler(

ServiceWorkerRequestHandler* ServiceWorkerRequestHandler::GetHandler(
net::URLRequest* request) {
return reinterpret_cast<ServiceWorkerRequestHandler*>(
return static_cast<ServiceWorkerRequestHandler*>(
request->GetUserData(&kUserDataKey));
}

Expand Down

0 comments on commit 037df0d

Please sign in to comment.