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

Side by Side Diff: ios/web/navigation/crw_session_controller.mm

Issue 2357463003: Fix a memory leak found by clang static analyzer. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | 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 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/web/navigation/crw_session_controller.h" 5 #import "ios/web/navigation/crw_session_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 else 836 else
837 _useDesktopUserAgentForNextPendingEntry = YES; 837 _useDesktopUserAgentForNextPendingEntry = YES;
838 } 838 }
839 839
840 #pragma mark - 840 #pragma mark -
841 #pragma mark Private methods 841 #pragma mark Private methods
842 842
843 - (NSString*)uniqueID { 843 - (NSString*)uniqueID {
844 CFUUIDRef uuidRef = CFUUIDCreate(NULL); 844 CFUUIDRef uuidRef = CFUUIDCreate(NULL);
845 CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef); 845 CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
846 CFRelease(uuidRef);
Eugene But (OOO till 7-30) 2016/09/20 21:59:40 How about simply: |return [NSUUID NSUUID].UUIDStri
sdefresne 2016/09/21 09:19:08 I'll leave this to you as owners of the code to de
847
846 NSString* uuid = 848 NSString* uuid =
847 [NSString stringWithString:base::mac::ObjCCastStrict<NSString>( 849 [NSString stringWithString:base::mac::ObjCCastStrict<NSString>(
848 CFBridgingRelease(uuidStringRef))]; 850 CFBridgingRelease(uuidStringRef))];
849 return uuid; 851 return uuid;
850 } 852 }
851 853
852 - (CRWSessionEntry*)sessionEntryWithURL:(const GURL&)url 854 - (CRWSessionEntry*)sessionEntryWithURL:(const GURL&)url
853 referrer:(const web::Referrer&)referrer 855 referrer:(const web::Referrer&)referrer
854 transition:(ui::PageTransition)transition 856 transition:(ui::PageTransition)transition
855 useDesktopUserAgent:(BOOL)useDesktopUserAgent 857 useDesktopUserAgent:(BOOL)useDesktopUserAgent
(...skipping 15 matching lines...) Expand all
871 std::unique_ptr<web::NavigationItemImpl> item(new web::NavigationItemImpl()); 873 std::unique_ptr<web::NavigationItemImpl> item(new web::NavigationItemImpl());
872 item->SetURL(loaded_url); 874 item->SetURL(loaded_url);
873 item->SetReferrer(referrer); 875 item->SetReferrer(referrer);
874 item->SetTransitionType(transition); 876 item->SetTransitionType(transition);
875 item->SetIsOverridingUserAgent(useDesktopUserAgent); 877 item->SetIsOverridingUserAgent(useDesktopUserAgent);
876 item->set_is_renderer_initiated(rendererInitiated); 878 item->set_is_renderer_initiated(rendererInitiated);
877 return [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]; 879 return [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)];
878 } 880 }
879 881
880 @end 882 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698