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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothUUID.cpp

Issue 2565913002: [Onion Soup] Move WebBluetoothImpl from //content/renderer/bluetooth to Blink's bluetooth module (Closed)
Patch Set: check if binding is bound before close it Created 3 years, 12 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/bluetooth/BluetoothUUID.h" 5 #include "modules/bluetooth/BluetoothUUID.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptRegexp.h" 8 #include "bindings/core/v8/ScriptRegexp.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 #include "platform/UUID.h" 10 #include "platform/UUID.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 String BluetoothUUID::canonicalUUID(unsigned alias) { 366 String BluetoothUUID::canonicalUUID(unsigned alias) {
367 StringBuilder builder; 367 StringBuilder builder;
368 builder.reserveCapacity(36 /* 36 chars or 128 bits, length of a UUID */); 368 builder.reserveCapacity(36 /* 36 chars or 128 bits, length of a UUID */);
369 appendUnsignedAsHexFixedSize( 369 appendUnsignedAsHexFixedSize(
370 alias, builder, 8 /* 8 chars or 32 bits, prefix length */, Lowercase); 370 alias, builder, 8 /* 8 chars or 32 bits, prefix length */, Lowercase);
371 371
372 builder.append("-0000-1000-8000-00805f9b34fb"); 372 builder.append("-0000-1000-8000-00805f9b34fb");
373 return builder.toString(); 373 return builder.toString();
374 } 374 }
375 375
376 // static
377 bluetooth::mojom::blink::UUIDPtr BluetoothUUID::createMojoUuid(
378 const String& uuid) {
379 bluetooth::mojom::blink::UUIDPtr result;
380 if (!uuid.isEmpty()) {
381 result = bluetooth::mojom::blink::UUID::New();
382 result->uuid = uuid;
383 }
384 return result;
385 }
386
376 } // namespace blink 387 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698